
import java.io.*;
import java.util.Scanner;


public class CH06_1 {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		System.out.println("Please input what you want to do:");
		
		String Search = scanner.nextLine();
		try {
			FileReader f = new FileReader("file.txt");
			BufferedReader br = new BufferedReader(f);
			String reader;
			while ((reader = br.readLine()) != null) {
				if (reader.indexOf(Search) != -1) {
					System.out.println("The result is :" + reader);
				}
			}
			
			br.close();
			f.close();
			System.out.println("Proccess Complete!!!");
			
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
